package com.edu.controller;

import com.edu.entity.Dict;
import com.edu.service.DictService;
import com.edu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName DictController
 * @Description
 * @Author W.Jian
 * @Date 2021/5/23 14:03
 **/
@RestController
@RequestMapping("dict")
public class DictController {

    @Autowired
    DictService dictService;


    /**
     *查询字典表
     * @param type
     * @return
     */
    @GetMapping("list")
    public Result list(String type, String value){
        return dictService.listByTypeLike(type, value);
    }

    /**
     * 添加字典表
     * @param dict
     * @return
     */
    @PostMapping("insert")
    public Result insert(Dict dict){

        return Result.success();
    }
}
